<template>
  <p>hello{{ msg }}</p>
  <p>数字时:{{ num }}</p>
  <button @click="changeValue">点击修改数字</button>
</template>

<script>
import { ref, h } from "vue";
export default {
  name: "app",
  setup() {
    let msg = "年后";
    let num = ref(20);

    function changeValue() {
      //在函数中能使用this
      console.log(num);
      // num.value += 2;
      this.num += 3;
    }
    // return {
    //   msg,
    //   num,
    //   changeValue,
    // };

    return () => h("button", "这个是vue3返回的解构");
  },
};
</script>

<style>
</style>
